define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'system.shielding/index',
        add_url: 'system.shielding/add',
        edit_url: 'system.shielding/edit',
        delete_url: 'system.shielding/delete',
        export_url: 'system.shielding/export',
        modify_url: 'system.shielding/modify',
    };

    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                defaultToolbar:['filter', {
                    title: '搜索',
                    layEvent: 'TABLE_SEARCH',
                    icon: 'layui-icon-search',
                    extend: 'data-table-id="' + 'user_group' + '"'
                }],
                toolbar:['refresh','add'],
                cols: [[
                    {type: 'checkbox'},
                    // {field: 'id', title: 'id'},
                    {field: 'ip', title: 'IP地址'},
                    {field: 'create_time', title: '创建时间'},
                    {field: 'operation', title: '操作人'},
                    // {field: 'username', title: '用户名称 屏蔽'},
                    // {field: 'rooms', title: '房间号'},
                    {width: 250, title: '操作', templet: ea.table.tool,operat:[
                            'delete'
                        ]},

                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;
});